import axios from "@/assets/request/request";
import { Comment, CommentSave, PageWithVideoId } from "@/types/comment";
import request from "@/assets/request";
import { PageReq } from "@/types/page";
import { Video } from "@/types/video";
interface commentPage {
  videoId: string;
  pageIndex: number;
  pageSize: number;
  isHot: boolean;
}



export default {
  getByVideoId: (params: commentPage) => {
    return axios({
      url: `/comment/getByVideoId/${params.videoId}/${params.pageIndex}/${params.pageSize}/${params.isHot}`,
      method: "get",
    });
  },
  save: (data: CommentSave) => {
    return axios({
      url: "/comment",
      method: "post",
      data: data,
    });
  },
  getAllSons: (parentId: string) => {
    return axios({
      url: `/comment/getAllSons/${parentId}`,
      method: "get",
    });
  },
  remove: (ids: string[]) => {
    return request.delete(`/comment`, { ids });
  },
  page: (pageInfo: PageWithVideoId) => {
    return request.get(`/comment/page`, pageInfo);
  }
};
